<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"> 
	<title></title>
	<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">  
	<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
	<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="tableApp" ng-controller="tablecontroller">


<div class="container">
	<div class="row clearfix">
		<div class="col-md-4 column">
		</div>
		<div class="col-md-4 column">
		<table class="table table-bordered">
			<caption></caption>
		   <thead>
		      <tr>
		         <th>名称</th>
		         <th>操作</th>
		      </tr>
		   </thead>
		   <tbody>
		      <tr ng-repeat="c in commodity">
		         <td>{{c.cname}}</td>
		         <td><button type="button" class="btn btn-danger" ng-click="delet(c.cId)">删除</button>&nbsp<button type="button" class="btn btn btn-info" ng-click="updateStart(c.cId,c.cname)">修改</button></td>
		      </tr>
		      
		   </tbody>
		</table>
		<button type="button" class="btn btn-primary"  ng-click="addStart()">添加</button>
		
		<button type="button" class="btn btn-success" ng-click="findStart()">查找</button>
		</div>
		<div class="col-md-4 column">
		</div>
	</div>
</div>
			<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
				aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabel">错误</h4>
						</div>
						<div class="modal-body" id="model">
							<label id="errorMsg">{{errorMsg}}</label>
						</div>
						<div class="modal-footer">

							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal -->
			</div>
			<div class="modal fade" id="myModal1" tabindex="-1" role="dialog"
				aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabel">提示</h4>
						</div>
						<div class="modal-body" id="model">
							<div class="input-group">
								<input type="text" class="form-control" ng-model="update" placeholder="{{cName}}">
								
							</div><!-- /input-group -->
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-success" ng-click="updateName()">确定</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal -->
			</div>
			<div class="modal fade" id="myModal2" tabindex="-1" role="dialog"
				aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabel">添加</h4>
						</div>
						<div class="modal-body" id="model">
							<div class="input-group">
								<input type="text" class="form-control" ng-model="addcName">
								
							</div><!-- /input-group -->
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-success" ng-click="addC()">确定</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal -->
			</div>
			<div class="modal fade" id="myModal3" tabindex="-1" role="dialog"
				aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabel">查找</h4>
						</div>
						<div class="modal-body" id="model">
							<div class="input-group">
								<input type="text" class="form-control" ng-model="findCname" >
								
							</div><!-- /input-group -->
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-success" ng-click="findC()">确定</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal -->
			</div>
<script src="/test/js/table.js">
		
	</script>
</body>
</html>